<?php echo $header; ?>
<div id="content">
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <?php if ($error_warning) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  <?php if ($success) { ?>
  <div class="success"><?php echo $success; ?></div>
  <?php } ?>
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/customer.png" alt="" />网站内容管理</h1>
      <div class="buttons"><a onclick="location = '<?php echo $insert; ?>'" class="button">添加</a><a onclick="$('form').attr('action', '<?php echo $delete; ?>'); $('form').submit();" class="button">删除</a></div>
    </div>
    <div class="content">
      <form action="" method="post" enctype="multipart/form-data" id="form">
        <table class="list">
          <thead>
            <tr>
              <td width="1" style="text-align: center;"><input type="checkbox" onclick="$('input[name*=\'selected\']').attr('checked', this.checked);" /></td>
              <td class="left"><?php if ($sort == 'fullname') { ?>
                <a href="<?php echo $sort_fullname; ?>" class="<?php echo strtolower($order); ?>">姓名</a>
                <?php } else { ?>
                <a href="<?php echo $sort_fullname; ?>">姓名</a>
                <?php } ?></td>
              <td class="left"><?php if ($sort == 'u.email') { ?>
                <a href="<?php echo $sort_email; ?>" class="<?php echo strtolower($order); ?>">Email</a>
                <?php } else { ?>
                <a href="<?php echo $sort_email; ?>">Email</a>
                <?php } ?></td>
              <td class="left"><?php if ($sort == 'u.status') { ?>
                <a href="<?php echo $sort_status; ?>" class="<?php echo strtolower($order); ?>">状态</a>
                <?php } else { ?>
                <a href="<?php echo $sort_status; ?>">状态</a>
                <?php } ?></td>
              <td class="left"><?php if ($sort == 'u.date_added') { ?>
                <a href="<?php echo $sort_date_added; ?>" class="<?php echo strtolower($order); ?>">加入时间</a>
                <?php } else { ?>
                <a href="<?php echo $sort_date_added; ?>">加入时间</a>
                <?php } ?></td>
              <td class="left">登录</td>
              <td class="right">删除</td>
            </tr>
          </thead>
          <tbody>
            <?php if ($users) { ?>
            <?php foreach ($users as $user) { ?>
            <tr>
              <td style="text-align: center;"><?php if ($user['selected']) { ?>
                <input type="checkbox" name="selected[]" value="<?php echo $user['user_id']; ?>" checked="checked" />
                <?php } else { ?>
                <input type="checkbox" name="selected[]" value="<?php echo $user['user_id']; ?>" />
                <?php } ?></td>
              <td class="left"><?php echo $user['fullname']; ?></td>
              <td class="left"><?php echo $user['email']; ?></td>
              <td class="left"><?php echo $user['status']; ?></td>
              <td class="left"><?php echo $user['date_added']; ?></td>
              <td class="left"><select onchange="((this.value !== '') ? window.open('index.php?route=management/user/login&token=<?php echo $token; ?>&user_id=<?php echo $user['user_id']; ?>&conf_id=' + this.value) : null); this.value = '';">
                  <option value="">--请选择会议--</option>
                  <option value="0">默认会议</option>
                  
                  <?php foreach ($stores as $store) { ?>
                  <option value="<?php echo $store['store_id']; ?>"><?php echo $store['name']; ?></option>
                  <?php } ?>
                </select></td>
              <td class="right"><?php foreach ($user['action'] as $action) { ?>
                [ <a href="<?php echo $action['href']; ?>"><?php echo $action['text']; ?></a> ]
                <?php } ?></td>
            </tr>
            <?php } ?>
            <?php } else { ?>
            <tr>
              <td class="center" colspan="10">无相关记录</td>
            </tr>
            <?php } ?>
          </tbody>
        </table>
      </form>
      <div class="pagination"><?php echo $pagination; ?></div>
    </div>
  </div>
</div>
<?php echo $footer; ?> 